<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function Person(name, age) {
				this.name = name;
				this.age = age;
				this.study = function() {
					console.log(this.name + "学习");
				}
			}

			//创建对象
			var p1 = new Person("张三", 20);
			// console.log(p1.name);
			// p1.study();
			// p1.cla = "29期";

			var p2 = new Person("李四", 30);
			// console.log(p2.name);
			// p2.study();
			// p2.cla = "29期";

			//----------------------静态属性------------------------------------
			Person.sex = "男";

			console.log(p1.sex); //undefined
			console.log(p2.sex); //undefined

			console.log(Person.sex);

			//----------------------对象原型------------------------------------------
			// Person.prototype.cla = "29期";
			
			console.log(p1.cla); //undefined
			console.log(p2.cla); //undefined
		</script>
	</head>
	<body>
	</body>
</html>
